import { App } from 'vue';
import { createRouter, createWebHistory } from 'vue-router';
import routes from './routes';
import guard from './guard';
import loadModuleRoutes from './loadModulesRoute';

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export function setupRouter(app: App) {
  loadModuleRoutes(router);
  guard();
  app.use(router);
}

export default router;
